﻿@using MVCMongo.Services
@{
    ViewBag.Title = "_partialNotification";
    var userId = WebSecurity.CurrentUserId;
    var count=UtilityService.FindingFriend(userId);
}

<ul class="icon-nav">
    <li class='dropdown'>
        <a href="#" class='dropdown-toggle' data-toggle="dropdown"><i class="icon-user"></i><span class="label label-lightred">@if (count != 0)
                                                                                                                               {
                                                                                                                                  @count
                                                                                                                               }
            </span></a>
        <ul class="dropdown-menu pull-right message-ul" style="width: 400px">
            <li class="subtitle name underline_text"> Friend Requests </li>
            <li>
                @foreach (var item in UtilityService.FriendRequestList(userId))
                {
                    
                    <a href="#" class="underline_text" style="float: left">
                       
                        @{
                    var imageUrl = UtilityService.GetCurrentUserImage(item.SenderId);
                        }
                        @if (!string.IsNullOrEmpty(imageUrl))
                        {
                            <img src="/content/UserProfile/User/@imageUrl"  />
                        }
                        else
                        {

                            <img src="~/Content/UserProfile/img/NoImage.jpg"  />
                        }
                        
                    </a>
                    <div class="details" style="padding: 10px">
                        <div class="pull-left">

                            <div class="name ">
                                <a href="@Url.Action("UserFriendProfile", new {friendId=item.SenderId})">@UtilityService.GetCurrentUserFullName(item.SenderId)


                                </a>  
                              
                            </div>
                            <div class="message">

                            </div>
                        </div>
                        <div class="pull-right">
                            <a href="@Url.Action("NotificationOff", new { friendRId = item.FriendRequestId, type="c" })" class="btn btn-small btn-primary" type="submit">Confirm</a>
                            <a href="@Url.Action("NotificationOff", new { friendRId = item.FriendRequestId, type = "n" })" class="btn btn-small" type="button">Not Now</a>
                        </div>
                    </div>



                }

            </li>


        </ul>
    </li>

    <li class='dropdown'>
        <a href="#" class='dropdown-toggle' data-toggle="dropdown"><i class="icon-envelope"></i><span class="label label-lightred">4</span></a>
        <ul class="dropdown-menu pull-right message-ul" style="width: 375px">
            <li class="subtitle name underline_text"> <span> Inbox(3) <span class="pull-right"><a>Send message</a></span>  </span></li>
            <li>
                <a href="#" class="underline_text">
                    <img src="/content/UserProfile/img/demo/user-1.jpg" alt="">
                    <div class="details">
                        <div class="name">Bebo</div>
                        <div class="message">
                            Lorem ipsum Commodo quis nisi ...
                        </div>
                    </div>
                </a>
            </li>
            <li>
                <a href="#" class="underline_text">
                    <img src="/content/UserProfile/img/demo/user-2.jpg" alt="">
                    <div class="details">
                        <div class="name">John Doedoe</div>
                        <div class="message">
                            Ut ad laboris est anim ut ...
                        </div>
                    </div>
                    <div class="count">
                        <i class="icon-comment"></i>
                        <span>3</span>
                    </div>
                </a>
            </li>
            <li>
                <a href="#" class="underline_text">
                    <img src="/content/UserProfile/img/demo/user-3.jpg" alt="">
                    <div class="details">
                        <div class="name">Bob Doe</div>
                        <div class="message">
                            Excepteur Duis magna dolor!
                        </div>
                    </div>
                </a>
            </li>
            <li>
                <a href="components-messages.html" class='more-messages'>See all <i class="icon-arrow-right"></i></a>
            </li>
        </ul>
    </li>


    <li class="dropdown sett">
        <a href="#" class='dropdown-toggle' data-toggle="dropdown"><i class="icon-cog"></i></a>
        <ul class="dropdown-menu pull-right theme-settings">

            <li>
                <a href="@Url.Action("UserProfileEdit","Profile")">Edit profile</a>
            </li>
            <li>
              
                <a href="@Url.Action("AccountSetting","Profile")">Account settings</a>
            </li>
            <li>
                <a href="@Url.Action("LogOff","Account")">Sign out</a>
            </li>

        </ul>
    </li>

</ul>